package rsb21411ls.d1202yichang;

import java.util.Scanner;

public class demo04 {/*
    public static void main(String[] args) {
       // Circle c=new Circle(-2);//无法发现的异常
        Scanner sc=new Scanner(System.in);
        //System.out.println(c.getArea());
        double r=sc.nextDouble();
        Circle c=null;
        try {
            c=new Circle1(r);
            System.out.println(c.getArea());
        }catch (Exception e){
            System.out.println(e.getMessage());
        }
    }
}
class Circle1{
    private  double r;

    public Circle1(double r)throws Exception{
        if (r<0){
            throw new Exception("半径不能是负数");
        }else {
        this.r=r;}
    }
    public double getArea(){
        return Math.PI*r*r;
    }*/
}

